package com.pansoft.openplanet.util;

import com.pansoft.openplanet.bean.Contact;

import java.util.Comparator;

/**
 * Created by will on 18-3-21.
 */

public class MobileContactsPinyinComparator implements Comparator<Contact> {

    public int compare(Contact o1, Contact o2) {//☆--# 升序
        if  (o1.getSortLetters().equals(o2.getSortLetters()) ) {//恒小于
            return 0;
        }
        if (o1.getSortLetters().equals("↑") ) {//恒小于
            return -1;
        }else if (o2.getSortLetters().equals("↑")) {//恒大于
            return 1;
        }else if (o1.getSortLetters().equals("☆") || o2.getSortLetters().equals("#")) {
            return -1;
        } else if (o1.getSortLetters().equals("#") || o2.getSortLetters().equals("☆")) {
            return 1;
        } else {
            return o1.getSortLetters().compareTo(o2.getSortLetters());
        }

    }

}